<template>
  <div>
    <div class="content">
      <div>
        <div class="newshead">
          <div class="title-head" title="专家库">专家库</div>
        </div>
      </div>
      <div class="newsarea">
        <div class="location">
          <div class="selectname">
            {{selectName}}
          </div>
          <div class="local">
            <span>当前位置：</span>
            <span><a href="/">首页</a></span>
            <el-divider direction="vertical"></el-divider>
            <span><a href="#">专家库</a></span>
          </div>
        </div>
        <div class="expert-area">
          <div class="item" v-for="(item,index) in expertList" :key="index">
            <el-image fit="cover" class="image" :src="item.imgUrl"></el-image>
            <div class="desc">
              <h1><em>姓名：</em>{{item.name}}</h1>
              <h1>职称：{{item.job}}</h1>
              <h1>从事领域：{{item.work}}</h1>
            </div>
          </div>
        </div>
        <div class="pageBox">
          <el-pagination background layout="prev, pager, next" :page-size="6" :total=total @current-change="getpage">
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'ExpertContent',
  data () {
    return {
      selectName: '专家库',
      pages: 1,
      total: 0,
      expertList: []
    }
  },
  methods: {
    getpage (e) {
      this.$axios({
        method: 'get',
        url: '/expert/select?page=' + e + '&pageSize=6'
      }).then((res) => {
        this.expertList = res.data.data.rows
      })
    },
    getExpert () {
      this.$axios({
        method: 'get',
        url: '/expert/select?page=1&pageSize=6'
      }).then((res) => {
        this.expertList = res.data.data.rows
        this.total = res.data.data.records
      })
    }
  },
  mounted () {
    this.getExpert()
  }
}
</script>

<style scoped>
.content {
  padding: 20px 100px;
  display: flex;
  margin-top: 60px;
  overflow: hidden;
}
.newshead {
  width: 300px;
  height: 60px;
  background: rgb(15, 66, 155);
  color: white;
  font-size: 25px;
  text-align: center;
  margin-bottom: 40px;
  overflow: hidden;
}
.newsarea {
  padding-left: 40px;
  width: 100%;
}
.location {
  height: 60px;
  display: flex;
  justify-content: space-between;
}
.selectname {
  color: #0f4a9b;
  font-size: 25px;
  height: 22px;
  margin: 20px 0;
}
.local {
  font-size: 18px;
  height: 22px;
  margin: 20px 0;
}
.title-head {
  line-height: 40px;
  margin: 10px 0;
  cursor: pointer;
}
a {
  text-decoration: none;
  color: black;
}
.pageBox {
  position: relative;
}
.el-pagination {
  position: relative;
  left: 25%;
}
.expert-area {
  width: 100%;
  background: white;
  overflow: hidden;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  align-items: center;
}
.item {
  width: 375px;
  height: 180px;
  position: relative;
  margin: 15px 10px;
  border: #cccccc 1px solid;
  border-radius: 5px;
}
.image {
  width: 120px;
  height: 160px;
  float: left;
  margin: 10px 5px;
}
.desc {
  margin: 10px 10px 10px 130px;
  height: 160px;
  line-height: 25px;
  font-size: 16px;
}
h1 {
  margin: 5px 0 5px 5px;
  font-weight: 600;
}
</style>
